package com.zhongshengnetwork.rightbe.common.customview;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.FrameLayout;
import android.widget.ScrollView;

/**
 * Created by yunjisoft on 2016/1/14.
 */
public class CustomFrameLayout extends FrameLayout {
    private OnSizeChangedListener listener;

    public CustomFrameLayout(Context context) {
        super(context);
    }

    public CustomFrameLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CustomFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }


    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        Log.d("TestE","onSizeChanged");
        if (listener != null){
            listener.onSizeChanged(w,h,oldw,oldh);
        }
    }

    public void setOnSizeChangedListener(OnSizeChangedListener listener){
        this.listener = listener;
    }

    public interface OnSizeChangedListener{
        public void onSizeChanged(int w, int h, int oldw, int oldh);
    }

}
